﻿<gui:AbstractInlineRefactorDialog x:Class="SharpRefactoring.Gui.OverrideToStringMethodDialog"
	Header="{sd:Localize AddIns.SharpRefactoring.OverrideToStringMethod}"
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:gui="clr-namespace:SharpRefactoring.Gui"
	xmlns:sd="http://icsharpcode.net/sharpdevelop/core"
	xmlns:widgets="http://icsharpcode.net/sharpdevelop/widgets"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
	<Grid Cursor="Arrow" KeyboardNavigation.TabNavigation="Cycle">
		<Grid.RowDefinitions>
			<RowDefinition Height="Auto" />
			<RowDefinition Height="*" />
			<RowDefinition Height="Auto" />
		</Grid.RowDefinitions>
		<TextBlock Margin="3"
		           Text="{sd:Localize AddIns.SharpRefactoring.OverrideToStringMethod.Description}"
		           TextWrapping="Wrap" />
		<ListBox x:Name="listBox" Grid.Row="1" Margin="4" SelectionMode="Multiple"
		         ItemContainerStyle="{x:Static sd:GlobalStyles.ListBoxItemFocusHighlightStyle}">
			<ListBox.ItemTemplate>
				<DataTemplate>
					<!-- The checkbox is toggling the actual IsSelected property on the container (ListBoxItem), so it'll update ListBox.SelectedItems -->
					<!-- Focusable=false because the ListViewItem is already focusable -->
					<CheckBox Content="{Binding Text}"
					          IsChecked="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType={x:Type ListBoxItem}},Path=IsSelected}" />
				</DataTemplate>
			</ListBox.ItemTemplate>
		</ListBox>
		<widgets:UniformGridWithSpacing Grid.Row="2" Columns="3" Margin="3" DockPanel.Dock="Bottom" HorizontalAlignment="Center">
			<Button Content="{sd:Localize Global.OKButtonText}" Click="OKButtonClick" Style="{x:Static sd:GlobalStyles.ButtonStyle}" />
			<Button Content="{sd:Localize Global.CancelButtonText}" Click="CancelButtonClick" Style="{x:Static sd:GlobalStyles.ButtonStyle}" />
			<ToggleButton x:Name="selectAll" Content="{sd:Localize Global.SelectAllButtonText}" IsChecked="{Binding AllSelected, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type gui:OverrideToStringMethodDialog}}, Mode=TwoWay}" Checked="SelectAllChecked" Unchecked="SelectAllUnchecked" />
		</widgets:UniformGridWithSpacing>
	</Grid>
</gui:AbstractInlineRefactorDialog>